srvMap.add('queryRegionTop10', '','front/sh/sceneMonitor!execute?uid=queryRegionTop10');//景区排行top10
srvMap.add('queryAreaCityForUser', '','front/sh/sceneMonitor!execute?uid=queryAreaCityForUser');//地图上地市
srvMap.add('queryGauge', '','front/sh/sceneMonitor!execute?uid=queryGauge');//仪表盘
srvMap.add('queryRegionTopByCity', '','front/sh/sceneMonitor!execute?uid=queryRegionTopByCity');//查询景区按地市分组前N个
srvMap.add('queryWarnByCity', '','front/sh/sceneMonitor!execute?uid=queryWarnByCity');//首页预警信息展示

srvMap.add('warnDealById', '','front/sh/sceneMonitor!execute?uid=warnDealById');//预警处理
srvMap.add('warnGroupDealById', '','front/sh/sceneMonitor!execute?uid=warnGroupDealById');//群发预警处理
srvMap.add('queryWarnDealInfoById', '','front/sh/sceneMonitor!execute?uid=queryWarnDealInfoById');//预警处理，信息查询（非群发）
srvMap.add('queryGroupWarnDealInfoById', '','front/sh/sceneMonitor!execute?uid=queryGroupWarn123');//预警处理，信息查询(群发)

var map; // 百度地图实例
var checkCityId = ""; //页面地市ID
var checkCityName = ""; //页面地市名称
var checkRegionType = ""; //页面已选景区级别：五级、四级、三级
var checkWarnId;//已选中告警Id
var defaultCityName = TOP_AREA_NAME;//用户权限范围对应名称
var blueIconUrl = "assets/css/images/blue_icon_01.png";
var yellowIconUrl = "assets/css/images/yellow_icon.gif";
var orangeIconUrl = "assets/css/images/orange_icon.gif";
var redIconUrl = "assets/css/images/red_icon.gif";
var greenIconUrl = "assets/css/images/green_icon.png";
var markers = []; //记录已撒点

var centerPoint={}; //省市级地图中心点

var warnMessageInfoObj = {};	//缓存管理员手机号码

$(function() {
	// 初始化页面
	initPage();
	// 初始地图，不包含数据
	initMap();
	$(document).ready(function(){
		//初始化仪表盘
		initGauge();			
		//初始化景区排行top10
		initRegionTop10();		
		//初始化预警信息
		initWarn();		
		//初始化天气
//		initWeather();
		//初始化地图景区撒点
		initRegionPoints("first");
	});
});

/**
 * 初始化页面
 * @return {[type]} [description]
 */
function initPage() {
	//高度设置
	$(".box,.leftBox,.rightBox").height($("body").height());
	$(".left_list,.map").height($("body").height() - 42);
	$(".left_list ul").height($("body").height() - 42);
	$(window).resize(function() {
		$(".box,.leftBox,.rightBox").height($("body").height());
		$(".left_list,.map").height($("body").height() - 42);
		$(".left_list ul").height($("body").height() - $(".left_list .cityTabs").height() - 62);
	});
	//城市选择
	$(".cityDiv").click(function() {
		if (!$(this).hasClass("cityDivShow")) {
			$(".cityList").show();
			$(this).addClass("cityDivShow");

		} else {
			$(".cityList").hide();
			$(this).removeClass("cityDivShow")
		}
	});
	//左侧收缩
	//左侧收缩
	$(".leftBox .switch").click(function() {
		if (!$(this).hasClass("switchShow")) {
			$(".leftBox").animate({
				opacity: "show",
				marginLeft: "-260px"
			}, "1000", function() {
				$(".leftBox").css("margin-left", -260);
				$(".leftBox .switch").addClass("switchShow");
			});
			$(".rightBox").animate({
				marginLeft: "0"
			}, "normal", function() {
				$(".rightBox").css("margin-left", 0);

				//向左扩大map范围
//				map.panTo(new BMap.Point(centerPoint.lon,centerPoint.lat),{noAnimation : true});
			});
		} else {
			$(".leftBox").animate({
				opacity: "show",
				marginLeft: "0px"
			}, "1000", function() {
				$(".leftBox").css("margin-left", 0);
				$(".leftBox .switch").removeClass("switchShow");
			});
			$(".rightBox").animate({
				marginLeft: "230px"
			}, "normal", function() {
				$(".rightBox").css("margin-left", 260);

				//向右缩小map范围
//				map.panTo(new BMap.Point(centerPoint.lon,centerPoint.lat),{noAnimation : true});
			});
		}
	});
	//左侧下钻

	/*绑定事件开始*/
	//搜索按钮
	$("#searchBtn").click(function() {
		initRegionTop10();
	});
	//搜索框回车
	$("#searchText").keydown(function(e) {
		if (e.keyCode == 13) {
			$("#searchBtn").trigger("click"); //处理事件
		}
	});
	//景区下拉列表
	$("#scenicOption").click(function() {
		var status = $(this).attr("status");
		if (status == "close") {
			$("#scenicOptionDown").show();
			$(this).attr("status", "open");
		} else {
			$("#scenicOptionDown").hide();
			$(this).attr("status", "close");
		}
	});
	$("#scenicOptionDownAll").click(scenicOptionClick);
	$("#scenicOptionDown5A").click(scenicOptionClick);
	$("#scenicOptionDown4A").click(scenicOptionClick);
	$("#scenicOptionDown3A").click(scenicOptionClick);

	//预警处理：取消
	$("#warnDealCancel").click(function (){
		$("#iMessage").hide();
		$("#warnningBox ul li .p4").attr("status","close");
	});
	//	群发预警处理：取消
	$("#warnDealCancleGroup").click(function (){
		$("#iMessageGroup").hide();
		$("#warnningBox ul li .p5").attr("status","close");
	});

	//预警处理：提交
	$("#warnDealSubmit").click(function (){
		var checkPhoneFlag=true;
		var warnId = "";
		var phones = "";
		var msgContent = "";
		warnId = $("#warnningBox ul li .p4[status='open']").attr("warnId");
		checkWarnId=warnId;
		msgContent = $("#msgContent").html().trim();
		if (msgContent==null||msgContent=="") {
			checkPhoneFlag = false;
		}
		$(".numberBox2 ul li input").each(function (){
			var flag = checkNameUnique($(this));
			if (!flag) {
//				$(this).
				checkPhoneFlag=false;
			}
			var phone = $(this).val().trim();
			if (phone!=null) {
				phones+=phone+',';
			}
		});

		if (!checkPhoneFlag) {
			return;
		}
		$("#iMessage").hide();
		var par = "&warnId="+warnId+"&phones="+phones+"&msgContent="+msgContent;
		Util.ajax.postJsonSync(srvMap.get('warnDealById'),par,function(json,status){
			if(status){
				alert("处理成功！")
				refreshData();
			}else{
				 alert('错误','数据异常！');   
			}
		});
	});
	
	//群发预警处理：提交
	$("#warnDealSubmitGroup").click(function (){
		var managerNum=$("#iMessageGroup").attr("size");
		if (managerNum==null||managerNum<1) {
			alert("群组无成员，请添加人员后再群发信息");
			return;
		}
		var checkPhoneFlag=true;
		var warnId = "";
		var areaId="";
		var phones = "";
		var msgContent = "";
		warnId = $("#warnningBox ul li .p5[status='open']").attr("warnId");
		areaId=  $("#warnningBox ul li .p5[status='open']").attr("areaId");
		checkWarnId=warnId;
		msgContent = $("#msgContentGroup").html().trim();
		$("#iMessageGroup").hide();
		var par = "&warnId="+warnId+"&regionId="+areaId+"&msgContent="+msgContent;
		Util.ajax.postJsonSync(srvMap.get('warnGroupDealById'),par,function(json,status){
			if(status){
				alert("处理成功！")
				refreshData();
			}else{
				 alert('错误','数据异常！');   
			}
		});
	});

	//返回全省
	$("#back2ProvBtn").click(function() {
		checkCityId = "";
		checkCityName = "";
		$("#areaNameTitle1").html(defaultCityName);
		$("#areaNameTitle2").html(defaultCityName);
		refreshData();
	});

	//群组发送开关
	$("#groupSendInput").on("click",function(){
		if( $(this).prop("checked")){
			if( warnMessageInfoObj.hasContent == true ){
				$("#phoneNums").empty().html(warnMessageInfoObj.htmlContent);
			}else{
				alert("未配置景区管理人员，无法使用群组发送功能！");
				return false;
			}
		}else{
			$("#phoneNums").empty().html(warnMessageInfoObj.defaultContent);
		}
	});
	/*绑定事件结束*/
}

/**
 * 景区类型列表点击事件
 */
function scenicOptionClick() {
	checkRegionType = $(this).attr("regionType");
	$("#scenicOptionDown").hide();
	$("#scenicOption").html($(this).html());
	$("#scenicOption").attr("status", "close");
	//切换景区类型刷新数据
	refreshData();
}

/**
 * 添加号码按钮增加事件
 */
function addPhoneOnclick(obj){
	var parentNode = obj.parentNode;
	parentNode.removeChild(obj);
	var li = document.createElement('li');
	var rand = Math.random();
	li.innerHTML = "<input id=\"phoneId_"+rand+"\"  onblur=\"checkNameUnique(this)\"  maxlength=\"11\" placeholder=\"请输入号码\" type=\"text\"><span id=\"phoneDelId_"+rand+"\" onclick=\"delPhoneOnclick(this)\">-</span>";
	spanHtml="<span id=\"addPhone\" onclick=\"addPhoneOnclick(this)\">+</span>";
	parentNode.appendChild(li);
	$("#phoneNums").append(spanHtml);
};

/**
 * 添加号码按钮删除事件
 */
function delPhoneOnclick(obj){
	var length = $("#phoneNums li").length;
	if (length<=1) {
		return;
	}
	var parentNode = obj.parentNode.parentNode;
	var phoneId = $(obj).attr("id").replace("phoneDelId","phoneId");
	var delObj = document.getElementById(phoneId);
	parentNode.removeChild(obj.parentNode);
};

/**
 *
 * @Description : 初始地图，不包含数据
 * @return void
 *
 * @author : wucm
 * @date : 2015年6月30日 上午10:51:48
 *
 */
function initMap() {
	if (typeof(BMap) == "undefined") {
		alert("网络延迟导致地图未正确加载，请手动刷新刷新页面重新加载");
		return;
	}
	if (!map) {
		map = new BMap.Map("map",{
			minZoom: MAP_MINZOOM,
			maxZoom: MAP_MAXZOOM
		});
		centerPoint.lon = DEPLOY_PROVINCE_CORE_LNG;
		centerPoint.lat = DEPLOY_PROVINCE_CORE_LAT;

		//		map.centerAndZoom(DEPLOY_PROVINCE_NAME_SHORT, 8);
		map.centerAndZoom(new BMap.Point(centerPoint.lon, centerPoint.lat), MAP_MINZOOM); // 初始化地图,设置中心点坐标和地图级别
		map.disableDoubleClickZoom();
		map.enableScrollWheelZoom(true);     //开启鼠标滚轮缩放

		// 地图自定义，屏蔽铁路等信息
		map.setMapStyle({
			styleJson: [{
				"featureType": "railway",
				"elementType": "all",
				"stylers": {
					"visibility": "off"
				}
			}, {
				"featureType": "highway",
				"elementType": "geometry",
				"stylers": {
					"visibility": "off"
				}
			}, {
				"featureType": "highway",
				"elementType": "labels",
				"stylers": {
					"visibility": "off"
				}
			}, {
				"featureType": "label",
				"elementType": "all",
				"stylers": {
					"visibility": "off"
				}
			}, {
				"featureType": "poi",
				"elementType": "all",
				"stylers": {
					"visibility": "off",
					"color": "#ffffff"
				}
			}, {
				"featureType": "administrative",
				"elementType": "all",
				"stylers": {
					"visibility": "off",
					"color": "#ffffff"
				}
			}, {
				"featureType": "background",
				"elementType": "all",
				"stylers": {
					"color": "#F3F2EE"
				}
			}]
		});
		// 初始地图上各地市
		initMapCity();
		//地图点击到省外，则恢复界面数据级别到省级
		map.addEventListener("click", function mapClick(e) {
			// 创建地理编码实例
			var myGeo = new BMap.Geocoder();
			// 根据坐标得到地址描述
			myGeo.getLocation(new BMap.Point(e.point.lng, e.point.lat), function(result) {
				if (result.addressComponents.province != null && result.addressComponents.province.substring(0, 2) != DEPLOY_PROVINCE_NAME_SHORT) {
					checkCityId = "";
					checkCityName = "";
					$("#areaNameTitle1").html(defaultCityName);
					$("#areaNameTitle2").html(defaultCityName);
					// refreshData();
				}
			});
		});
	}
};

/**
 *
 * @Description : 初始化地图上各地市
 * @return void
 *
 * @author : wucm
 * @date : 2015年7月20日 下午4:02:49
 *
 */
function initMapCity() {
	Util.ajax.postJsonSync(srvMap.get('queryAreaCityForUser'),null,function(json,status){
		if(status){
			
			var citys = json.object.regions;
			refreshDataRange(citys);
			for (var i = 0; i < citys.length; i++) {
				if (citys[i].hasRight) {
					var c = citys[i];
					// 添加各地市名称的标签
					loadMapCityLabel(c);

					// 初始化市级区域边界
					initMapBoundary(c);

					// 初始化市级区域边界，对监控区域特殊处理
					initMapBoundaryWarn(c);
				}
			}
		}else{
			 alert('错误','数据异常！');   
		}
	});
}

/**
 *
 * @Description : 初始化景区排行榜top10
 * @return void
 *
 * @author : pengjy
 * @date : 2015年11月10日 下午4:05:30
 *
 */
function initRegionTop10() {
	var searchValue = $("#searchText").val();
	if (searchValue == "搜索景区，请输入名称") {
		searchValue = "";
	}
	var par = "&searchValue="+searchValue+"&cityId="+checkCityId+"&regionType="+checkRegionType;
	Util.ajax.postJsonSync(srvMap.get('queryRegionTop10'),par,function(json,status){
		if(status){
			builTop10(json.object.regions);
		}else{
			 alert('错误','数据异常！');   
		}
	});
	
}
/**
 *
 * @Description : 初始化景区排行榜top10
 * @return void
 *
 * @author : pengjy
 * @date : 2015年11月10日 下午4:05:30
 *
 */
function builTop10(data) {
	var tbody = $("#top10body");
	tbody.empty();
	var top10Html = "";
	if (data == null || data.length == 0) {
		top10Html = "<tr><td align='center' colspan='11' style='color:red;'>没有相关数据！</td></tr>";
		tbody.html(top10Html);
	}
	for (var i = 0; i < data.length; i++) {
		var orderId = data[i].orderId;
		var areaName = data[i].areaName;
		var stayPersonCnts = data[i].stayPersonCnts;
		var hisAvgVstCnts = data[i].hisAvgVstCnts;
		//var tmpHtml = "<tr><td class=\"td1\">$orderId</td><td>$areaName</td><td>$stayPersonCnts</td><td>$hisAvgVstCnts</td></tr>";
		var tmpHtml = "<tr><td class=\"td1\">$orderId</td><td>$areaName</td><td>$stayPersonCnts</td></tr>";
		tmpHtml = tmpHtml.replace(/\$orderId/g, orderId);
		tmpHtml = tmpHtml.replace(/\$areaName/g, areaName);
		tmpHtml = tmpHtml.replace(/\$stayPersonCnts/g, stayPersonCnts + "人");
		//tmpHtml = tmpHtml.replace(/\$hisAvgVstCnts/g, hisAvgVstCnts + "人");
		top10Html += tmpHtml;
	}
	tbody.html(top10Html);
}

/**
 *
 * @Description : 添加各地市名称的标签
 * @return void
 *
 * @author : wucm
 * @date : 2015年5月29日 下午1:41:26
 *
 */
function loadMapCityLabel(city) {
	var areaId = city.areaId;
	var areaName = city.areaName;
	var coreLongitude = city.coreLongitude;
	var coreLatitude = city.coreLatitude;
	var hasRight = city.hasRight;

	if (!hasRight) {
		return;
	}
	var opts = {
		position: new BMap.Point(coreLongitude, coreLatitude), // 指定文本标注所在的地理位置
		offset: new BMap.Size(-10, -25)
			// 设置文本偏移量
	}
	var label = new BMap.Label(areaName, opts); // 创建文本标注对象
	label.setStyle({
//		color: "#ffffff",
		color:"#041259",
		fontSize: "14px",
		height: "20px",
		lineHeight: "20px",
		fontFamily: "微软雅黑",
		border :"0",
		borderColor: "#fff",
		backgroundColor: "0.05",
		//padding: "3px 5px",
		opacity: 0.7
	});
	label.addEventListener("click", function() {
		checkCityId = areaId;
		checkCityName = areaName;
		$("#areaNameTitle1").html(areaName);
		$("#areaNameTitle2").html(areaName);
		refreshData();
	});
	map.addOverlay(label);
	label.setStyle({
		cursor: "pointer",
	});
};

/**
 *
 * @Description : 初始化市级区域边界
 * @return void
 *
 * @author : wucm
 * @date : 2015年5月29日 下午1:40:32
 *
 */
function initMapBoundary(city) {
	var areaId = city.areaId;
	var areaName = city.areaName;
	var coreLongitude = city.coreLongitude;
	var coreLatitude = city.coreLatitude;

	var hasRight = city.hasRight;
	if (hasRight) {
		return;
	}
	var bdary = new BMap.Boundary();
	bdary.get(areaName, function(rs) { // 获取行政区域
		var ply = new BMap.Polygon(rs.boundaries[0], {
			strokeWeight: 2,
			strokeColor: "#6495ed",
			fillOpacity: 0.3,
			fillColor: "#f4f3ef"
		}); // 建立多边形覆盖物
		map.addOverlay(ply); // 添加覆盖物
	});
};

/**
 *
 * @Description : 初始化市级区域边界，对监控区域特殊处理
 * @return void
 *
 * @author : wucm
 * @date : 2015年6月30日 上午11:09:47
 *
 */
function initMapBoundaryWarn(city) {
	var areaId = city.areaId;
	var areaName = city.areaName;
	var coreLongitude = city.coreLongitude;
	var coreLatitude = city.coreLatitude;
	var hasRight = city.hasRight;

	if (null == coreLongitude || null == coreLatitude || !hasRight) {
		return;
	}

	var bdary = new BMap.Boundary();
	bdary.get(areaName, function(rs) { // 获取行政区域
		var ply = new BMap.Polygon(rs.boundaries[0], {
			strokeWeight: 2,
			strokeColor: "#6495ed",
			fillOpacity: 0.3,
			fillColor: "#4ecaee"
		}); // 建立多边形覆盖物
		map.addOverlay(ply); // 添加覆盖物
		ply.addEventListener("mouseover", function() {
			ply.setFillColor("#cdbc43");
			ply.setFillOpacity("0.3");
		});
		ply.addEventListener("mouseout", function() {
			ply.setFillColor("#4ecaee");
			ply.setFillOpacity("0.3");
		});
		ply.addEventListener("click", function() {
			checkCityId = areaId;
			checkCityName = areaName;
			$("#areaNameTitle1").html(areaName);
			$("#areaNameTitle2").html(areaName);
			refreshData();
		});

	});
};

/**
 *
 * @Description : 初始化景区撒点
 * @return void
 *
 * @author : pengjy
 * @date : 2015年11月11日 上午11:09:47
 *
 */
function initRegionPoints(pointFlag) {
	var topNum = "";
	if (pointFlag != "first") {
		topNum = 99999;
	}
	var par = "&cityId="+checkCityId+"&regionType="+checkRegionType+"&topNum="+topNum;
	Util.ajax.postJsonSync(srvMap.get('queryRegionTopByCity'),par,function(json,status){
		if(status){
			buildRegionPoits(json.object.data);
		}else{
			 alert('错误','数据异常！');   
		}
	});
}

/**
 *
 * @Description : 创建景区撒点
 * @return void
 *
 * @author : pengjy
 * @date : 2015年11月11日 上午11:09:47
 *
 */
function buildRegionPoits(data) {
	if (markers != null && markers.length > 0) {
		for (var i = 0; i < markers.length; i++) {
			map.removeOverlay(markers[i]);
		}
	}
	for (var i = 0; i < data.length; i++) {
		var areaId = data[i].areaId;
		var areaName = data[i].areaName;
		var warnLevelId = data[i].warnLevelId;
		var stayPersonCnts = data[i].stayPersonCnts;
		var sumVstCnts = data[i].sumVstCnts;
		var lat = data[i].lat;
		var lng = data[i].lng;
		var point = new BMap.Point(lng, lat);


		// 展示区域的marker
		var blueIcon = new BMap.Icon(greenIconUrl,
			new BMap.Size(30, 50));
		var marker = new BMap.Marker(point, {
			icon: blueIcon
		});
		if (warnLevelId == "1") {
			var yellowIcon = new BMap.Icon(yellowIconUrl, new BMap.Size(30, 50));
			marker.setIcon(yellowIcon);
		} else if (warnLevelId == "2") {
			var orangeIcon = new BMap.Icon(orangeIconUrl, new BMap.Size(30, 50));
			marker.setIcon(orangeIcon);
		} else if (warnLevelId == "3") {
			var redIcon = new BMap.Icon(redIconUrl, new BMap.Size(30, 50));
			marker.setIcon(redIcon);
		}
		marker.addEventListener("mouseover", function() {
			regionMkMouseover(this);
		});
		marker.addEventListener("mouseout", function() {
			regionMkMouseout(this);
		});
		marker.addEventListener("click", function() {
			//左侧景区列表点击事件--跳转到子监控页面
				var regionId = this.region.areaId;
				var _regionId = regionId.EncodeBase64();
				location.href=CONTENT_PATH+"/zhly/scene_monitor_sub.jsp?regionId="+_regionId;
		});
		marker.region = data[i];
		map.addOverlay(marker);
		markers.push(marker);
	}
}

/**
 *
 * @Description : 展示景点悬浮信息
 * @return void
 *
 * @author : pengjy
 * @date : 2015年11月11日 上午11:09:47
 *
 */
function regionMkMouseover(obj) {
	var lableHtml = "<div class='warnning_tanchuang'> <p class='$photoS'></p><ul>" + "<li class='li1S'>$areaName</li>" + "<li class='li2S'><div class='div1'><span>$stayPersonCnts</span> <p>实时<br/>客流</p></div><div class='div2'><span>$sumVstCnts</span> <p>今日<br/>累计</p></div></li>" + "</ul><div class='warnning_corner'></div></div>";
	switch (obj.region.regionType){
	case '1':
		lableHtml = lableHtml.replace(/\$photoS/g, 'photoS1');
		break;
	case '2':
		lableHtml = lableHtml.replace(/\$photoS/g, 'photoS2');
		break;
	case '3':
		lableHtml = lableHtml.replace(/\$photoS/g, 'photoS3');
		break;
	case '4':
		lableHtml = lableHtml.replace(/\$photoS/g, 'photoS4');
		break;
	case '5':
		lableHtml = lableHtml.replace(/\$photoS/g, 'photoS5');
		break;
	default:
		lableHtml = lableHtml.replace(/\$photoS/g, 'photoS0');
	}
	lableHtml = lableHtml.replace(/\$areaName/g, obj.region.areaName);
	lableHtml = lableHtml.replace(/\$stayPersonCnts/g, obj.region.stayPersonCnts);
	lableHtml = lableHtml.replace(/\$sumVstCnts/g, obj.region.sumVstCnts);
	var opts = {
		width: 400, // 信息窗口宽度
		enableMessage: false
	};
	var infoWindow = new BMap.InfoWindow(lableHtml, opts);
	infoWindow.addEventListener("open", function(e) {
		// 移除关闭图标
		$.each($(".BMap_pop").find("img"), function() {
			$(this).remove();
		});

		// 移除百度信息框自带的外边框
		$(".BMap_pop").find(".BMap_top").removeClass("BMap_top");
		$(".BMap_pop").find(".BMap_center").removeClass("BMap_center");
		$(".BMap_pop").find(".BMap_bottom").removeClass("BMap_bottom");

		$($(".BMap_pop").children("div")[0]).empty();
		$($(".BMap_pop").children("div")[2]).empty();
		$($(".BMap_pop").children("div")[4]).empty();
		$($(".BMap_pop").children("div")[6]).empty();
	});
	obj.openInfoWindow(infoWindow);
	// $(".BMap_shadow").hide();
}

/**
 *
 * @Description : 隐藏景点悬浮信息
 * @return void
 *
 * @author : pengjy
 * @date : 2015年11月11日 上午11:09:47
 *
 */
function regionMkMouseout(obj) {
	map.closeInfoWindow();
}

/**
 *
 * @Description : 初始化仪表盘
 * @return void
 *
 * @author : pengjy
 * @date : 2015年11月11日 上午11:09:47
 *
 */
function initGauge() {

	var par = "&cityId="+checkCityId+"&regionType="+checkRegionType;
	Util.ajax.postJsonSync(srvMap.get('queryGauge'),par,function(json,status){
		if(status){
			buildGauge(json.object.gaugeDate);
			// buildGauge(req.result);
		}else{
			 alert('错误','数据异常！');   
		}
	});
}

/**
 *
 * @Description : 展示化仪表盘
 * @return void
 *
 * @author : pengjy
 * @date : 2015年11月11日 上午11:09:47
 *
 */
function buildGauge(data) {
	var stayPersonCnts = 0;
	var sumVstCnts = 0;
	var gaugeVaule = 0;
	if (data != null && data.length > 0) {
		stayPersonCnts = data[0].stayPersonCnts;
		sumVstCnts = data[0].sumVstCnts;
		gaugeVaule = sumVstCnts == 0 ? 0 : Math.round(stayPersonCnts / sumVstCnts * 100);
	}
	$("#stayPersonCnts").html(stayPersonCnts);
	$("#sumVstCnts").html(sumVstCnts);

	require.config({
		paths: {
			echarts: CONTENT_PATH + '/common/js'
		}
	});
	require(
		[
			'echarts',
			'echarts/chart/gauge'
		],
		function(ec) {
			var myChart = ec.init(document.getElementById('gaugeDiv'));

			option = {
				tooltip: {
					formatter: "{a} <br/>{c}%"
				},
				series: [{
					name: '景区当前游客数',
					type: 'gauge',
					center: ['50%', '85%'], // 默认全局居中
					radius: [0, '170%'],
					startAngle: 180,
					endAngle: 0,
					min: 0, // 最小值
					max: 100, // 最大值
					precision: 0, // 小数精度，默认为0，无小数点
					splitNumber: 10, // 分割段数，默认为5
					axisLine: { // 坐标轴线
						lineStyle: { // 属性lineStyle控制线条样式
							color: [
								[0.166, '#158E3E'],
								[0.333, '#8EC655'],
								[0.5, '#BCE02D'],
								[0.666, '#E6F30F'],
								[0.833, '#E0BB11'],
								[1, '#D54119']
							],
							width: 8
						}
					},
					axisTick: { // 坐标轴小标记
						splitNumber: 10, // 每份split细分多少段
						length: 10, // 属性length控制线长
						lineStyle: { // 属性lineStyle控制线条样式
							color: 'auto'
						}
					},
					axisLabel: { // 坐标轴文本标签，详见axis.axisLabel
						textStyle: { // 其余属性默认使用全局文本样式，详见TEXTSTYLE
							color: 'auto'
						}
					},
					splitLine: { // 分隔线
						show: true, // 默认显示，属性show控制显示与否
						length: 15, // 属性length控制线长
						lineStyle: { // 属性lineStyle（详见lineStyle）控制线条样式
							color: 'auto'
						}
					},
					pointer: {
						width: 10
					},
					title: {
						show: true,
						offsetCenter: [0, '-40%'], // x, y，单位px
						textStyle: { // 其余属性默认使用全局文本样式，详见TEXTSTYLE
							fontWeight: 'bolder'
						}
					},
					detail: {
						show: false,
						formatter: '{value}%',
						textStyle: { // 其余属性默认使用全局文本样式，详见TEXTSTYLE
							color: 'auto',
							fontWeight: 'bolder'
						}
					},
					data: [{
						value: gaugeVaule,
						name: ""
					}]
				}]
			};
			myChart.setOption(option);
		}
	);
}

/**
 *
 * @Description : 初始化天气
 * @return void
 *
 * @author : pengjy
 * @date : 2015年11月11日 上午11:09:47
 *
 */
function initWeather(cityName) {
	if (cityName == null || cityName == TOP_AREA_NAME || cityName =="") {
		 cityName = DEPLOY_PROVINCE_CAPITAL_NAME; //展示天气的地市
	}
	BWeather.weather(cityName, function callback(data) {
		var mainWeatherCity = data.results[0].currentCity;
		var mainWeather = data.results[0].weather_data[0].weather; //天气：多云..等
		var mainTemperature = data.results[0].weather_data[0].date.substring(14, 17); //气温：5℃
		//var icon = data.results[0].weather_data[0].dayPictureUrl;
		var pm25 = data.results[0].pm25;
		$("#mainWeatherCity").html(mainWeatherCity);
		$("#mainWeather").html(mainWeather);
		$("#mainTemperature").html(mainTemperature);
		$("#weatherIcon").css("width:auto", null);
		//$("#weatherIcon").css("background", "url(" + icon + ") no-repeat center center");
		//处理天气面板
		var wBoxULHtml="";
		var weatherData = data.results[0].weather_data;
		var todayH1="";
		for (var i = 0; i < weatherData.length; i++) {
			var tStr ="";
			if (i == 0) {
				var h1=weatherData[0].date;
				todayH1 = "<span>$h1</span>";
				todayH1=todayH1.replace(/\$h1/g,h1);
				var temperature = weatherData[i].temperature;
				var weather = weatherData[i].weather;
				var wind = weatherData[i].wind
				var weatherPic=getWeatherPic(weather);
				$("#weatherIcon").css("background", "url(" + weatherPic + ") no-repeat center center");
				$("#weatherIcon").css("background-size", "70%");
				$("#weatherIcon").css("background-color", "#C8D6FD");
				
				tStr="<li ><div class=\"today_weather\"><div class=\"big_icon_weather\">" +
				//assets/css/images/weather/TB_yin.png
						"<img src=\"$wPic\" width=\"70\" height=\"70\"  alt=\"\"/></div>" +
						"<h2>$temperature</h2><h3>$weather</h3>" +
						"<p>$wind</p><p>空气质量：<i style=\"background-color:$color\">$pm25</i></p></div></li>";
				tStr = tStr.replace(/\$temperature/g,temperature);
				tStr = tStr.replace(/\$weather/g,weather);
				tStr = tStr.replace(/\$wind/g,wind);
				tStr = tStr.replace(/\$wPic/g,weatherPic);
				if (pm25<=50) {
					tStr = tStr.replace(/\$pm25/g,pm25+"优");
					tStr = tStr.replace(/\$color/g,"#6EB720");
				}else if (pm25>50 && pm25<=100) {
					tStr = tStr.replace(/\$pm25/g,pm25+"良");
					tStr = tStr.replace(/\$color/g,"#D6C60F");
				}else if (pm25>100 && pm25<= 150) {
					tStr = tStr.replace(/\$pm25/g,pm25+"轻度污染");
					tStr = tStr.replace(/\$color/g,"#EC7E22");
				}else if (pm25>150 && pm25<=200) {
					tStr = tStr.replace(/\$pm25/g,pm25+"中度污染");
					tStr = tStr.replace(/\$color/g,"E92D00");
				}else if (pm25>200) {
					tStr = tStr.replace(/\$pm25/g,pm25+"重度污染");
					tStr = tStr.replace(/\$color/g,"#B414BB");
				}
			}else {
				var week = weatherData[i].date;
				var date = getDateByNum(i);
				var temperature = weatherData[i].temperature;
				var weather = weatherData[i].weather;
				var wind = weatherData[i].wind;
				var weatherPic=getWeatherPic(weather);
				tStr = " <li ><div class=\"next_weather\">" +
				"<p>$week</p><p class=\"pgreycolor\">$date</p><div class=\"min_icon_weather\"> " +
				//assets/css/images/weather/TB_yin_min.png
				"<img src=\"$wPic\" width=\"45\" height=\"45\"  alt=\"\"/></div>" +
				"<p>$temperature</p><p>$weather</p><p>$wind</p></div></li>"
				tStr = tStr.replace(/\$week/g,week);
				tStr = tStr.replace(/\$date/g,date);
				tStr = tStr.replace(/\$temperature/g,temperature);
				tStr = tStr.replace(/\$weather/g,weather);
				tStr = tStr.replace(/\$wind/g,wind);
				tStr = tStr.replace(/\$wPic/g,weatherPic);
			}
			wBoxULHtml+=tStr;
		}
		$("#weatherBoxH1").html(todayH1);
		$("#weatherBoxUL").html(wBoxULHtml);
	});
}

/**
 *
 * @Description : 初始化告警信息展示
 * @return void
 *
 * @author : pengjy
 * @date : 2015年11月11日 上午11:09:47
 *
 */
function initWarn() {

	var par = "&cityId="+checkCityId+"&regionType="+checkRegionType;
	Util.ajax.postJsonSync(srvMap.get('queryWarnByCity'),par,function(json,status){
		if(status){
			buildWarn(json.object.data);
		}else{
			 alert('错误','数据异常！');   
		}
	});
}

/**
 *
 * @Description : 展示告警信息展示
 * @return void
 *
 * @author : pengjy
 * @date : 2015年11月11日 上午11:09:47
 *
 */
function buildWarn(data) {
	var yellow = []; //黄色预警数据
	var orange = []; //橙色预警数据
	var red = []; //红色预警数据
	var allWarnNum = 0; //总预警个数
	var yellowHtml = "";
	var orangeHtml = "";
	var redHtml = "";
	//预警分类
	if (data != null && data.length > 0) {
		allWarnNum = data.length;
		for (var i = 0; i < data.length; i++) {
			if (data[i].warnLevelId == "1") {
				yellow.push(data[i]);
			} else if (data[i].warnLevelId == "2") {
				orange.push(data[i]);
			} else if (data[i].warnLevelId == "3") {
				red.push(data[i]);
			}
		}
	}
	//处理红色
	if (red.length > 0) {
		redHtml = "<h2 class=\"red\">红色预警&nbsp;$redNum&nbsp;个</h2>";
		for (var i = 0; i < red.length; i++) {
			var lastFlag = i == red.length - 1 ? "lastLi" : "notLastLi";
			red[i].orderId = i + 1;
			redHtml += getWarnHtml(red[i], lastFlag);
		}
	} else {
		redHtml = "<h2 class=\"red\">红色预警&nbsp;$redNum&nbsp;个</h2><li class=\"lastLi\">没有相关数据!</li>";
	}
	//处理橙色
	if (orange.length > 0) {
		orangeHtml = "<h2 class=\"orange\">橙色预警&nbsp;$orangeNum&nbsp;个</h2>";
		for (var i = 0; i < orange.length; i++) {
			var lastFlag = i == orange.length - 1 ? "lastLi" : "notLastLi";
			orange[i].orderId = i + 1;
			orangeHtml += getWarnHtml(orange[i], lastFlag);
		}
	} else {
		orangeHtml = "<h2 class=\"orange\">橙色预警&nbsp;$orangeNum&nbsp;个</h2><li class=\"lastLi\">没有相关数据!</li>";
	}
	//处理黄色
	if (yellow.length > 0) {
		yellowHtml = "<h2 class=\"yellow\">黄色预警&nbsp;$yellowNum&nbsp;个</h2>";
		for (var i = 0; i < yellow.length; i++) {
			var lastFlag = i == yellow.length - 1 ? "lastLi" : "notLastLi";
			yellow[i].orderId = i + 1;
			yellowHtml += getWarnHtml(yellow[i], lastFlag);
		}
	} else {
		yellowHtml = "<h2 class=\"yellow\" >黄色预警&nbsp;$yellowNum&nbsp;个</h2><li class=\"lastLi\">没有相关数据!</li>";
	}
	//刷新个数
	redHtml = redHtml.replace(/\$redNum/g, red.length);
	orangeHtml = orangeHtml.replace(/\$orangeNum/g, orange.length);
	yellowHtml = yellowHtml.replace(/\$yellowNum/g, yellow.length);
	$("#allWarnNum").html("共" + allWarnNum + "个");
	$("#redWarnUL").empty().html(redHtml);
	$("#orangeWarnUL").empty().html(orangeHtml);
	$("#yellowWarnUL").empty().html(yellowHtml);
}

/**
 *
 * @Description : 生成预警列表HTML
 * @return string
 *
 * @author : pengjy
 * @date : 2015年11月11日 上午11:09:47
 *
 */
function getWarnHtml(warn, flag) {
	var html = "";
	if (flag == "lastLi") {
		html = "<li class=\"lastLi\"><p class=\"p1\">$orderId</p><p class=\"p2\">$areaName</p><p class=\"p3\">$stayPersonCnts人</p><p class=\"p4\" onclick=\"warnDealOnClick(this)\" areaId=\"$areaId\" areaName= \"$areaName\"warnId=\"$warnId\" status=\"close\"></p><p class=\"p5\" onclick=\"warnDealOnClickGroup(this)\" areaId=\"$areaId\" areaName= \"$areaName\"warnId=\"$warnId\" status=\"close\"></p></li>"
	} else {
		html = "<li><p class=\"p1\">$orderId</p><p class=\"p2\">$areaName</p><p class=\"p3\">$stayPersonCnts人</p><p class=\"p4\" onclick=\"warnDealOnClick(this)\" areaId=\"$areaId\" areaName= \"$areaName\" warnId=\"$warnId\" status=\"close\"><p class=\"p5\" onclick=\"warnDealOnClickGroup(this)\" areaId=\"$areaId\" areaName= \"$areaName\" warnId=\"$warnId\" status=\"close\"></p></li>"
	}
	html = html.replace(/\$orderId/g, warn.orderId);
	html = html.replace(/\$areaId/g, warn.areaId);
	html = html.replace(/\$warnId/g, warn.warnId);
	var show_name=warn.areaName;
	if(show_name.length>5){
		show_name=show_name.substr(0,4)+"…";
	}
	
	html = html.replace(/\$areaName/g,show_name);
	html = html.replace(/\$stayPersonCnts/g, warn.stayPersonCnts);
	return html;
}

/**
 *
 * @Description : 预警处理点击事件
 * @return string
 *
 * @author : pengjy
 * @date : 2015年11月11日 上午11:09:47
 *
 */
function warnDealOnClick(obj) {
	//关掉所有单发短信
	$("#warnningBox ul li .p5").attr("status", "close");
	$("#iMessageGroup").hide();
	var status = $(obj).attr("status");
	if (status == "close") {
		var warnId = $(obj).attr("warnId");
		initMessageBox(warnId);
		$("#iMessage").show();
		$("#warnningBox ul li .p4").attr("status", "close");
		$(obj).attr("status", "open");
	} else {
		$("#iMessage").hide();
		$(obj).attr("status", "close");
	}

}

/**
*
* @Description : 群发预警处理点击事件
* @return string
*
* @author : pengjy
* @date : 2015年11月11日 上午11:09:47
*
*/
function warnDealOnClickGroup(obj) {
	//关掉所有单发短信
	$("#warnningBox ul li .p4").attr("status", "close");
	$("#iMessage").hide();
	var qfAreaId=$(obj).attr("areaId");
	var status = $(obj).attr("status");
	if (status == "close") {
		initMessageBoxGroup(obj);
		$("#iMessageGroup").show();
		$("#warnningBox ul li .p5").attr("status", "close");
		$(obj).attr("status", "open");
		$("#iMessageGroup").attr("areaId", qfAreaId);
	} else {
		$("#iMessageGroup").hide();
		$(obj).attr("status", "close");
	}

}

/**
 *
 * @Description : 刷新界面数据
 * @return string
 *
 * @author : pengjy
 * @date : 2015年11月11日 上午11:09:47
 *
 */
function refreshData() {
	$("#scenicOption").attr("status", "close");
	$("#scenicOptionDown").hide();
	$("#warnningBox ul li .p4").attr("status", "close");
	$("#iMessage").hide();
	initGauge();
	initRegionTop10();
	initWarn();
	initRegionPoints();
	initWeather(checkCityName==null?defaultCityName:checkCityName);
}

/**
 *
 * @Description : 刷新当前数据范围展示
 * @return string
 *
 * @author : pengjy
 * @date : 2015年11月11日 上午11:09:47
 *
 */
function refreshDataRange(citys) {
	var num = 0;
	var city = new Object();
	for (var i = 0; i < citys.length; i++) {
		if (citys[i].hasRight) {
			num++;
			city = citys[i];
		}
	}
	if (num == 1) {
		defaultCityName = city.areaName;
		map.centerAndZoom(new BMap.Point(city.coreLongitude, city.coreLatitude), MAP_MINZOOM);

		centerPoint.lon = city.coreLongitude;
		centerPoint.lat = city.coreLatitude;
	}else {
		defaultCityName = TOP_AREA_NAME;
	}

	// 选中提示初始的时候必须等于默认地市
	checkCityName = defaultCityName;

	$("#areaNameTitle1").html(defaultCityName);
	$("#areaNameTitle2").html(defaultCityName);
	initWeather(defaultCityName);
}

/**
 * 刷新信息发送框
 */
function initMessageBox(warnId){
	var par = "&warnId="+warnId;
	Util.ajax.postJsonSync(srvMap.get('queryWarnDealInfoById'),par,function(json,status){
		if(status){
			buildMessigeBox(json.object);
		}else{
			 alert('错误','数据异常！');   
		}
	});
}

/**
 * 刷新群发信息发送框
 */
function initMessageBoxGroup(obj){
	var warnId = $(obj).attr("warnId");
	var areaNameGroup=$(obj).attr("areaName");
	$("#numberGroup li a").html(areaNameGroup+"群发组");
	var par = "&warnId="+warnId;
	Util.ajax.postJsonSync(srvMap.get('queryGroupWarnDealInfoById'),par,function(json,status){
		if(status){
			buildMessigeBoxGroup(json.object);
		}else{
			 alert('错误','数据异常！');   
		}
	});
}

/**
 * 创建预警处理框
 * @param data
 */
function buildMessigeBox(requestResult){
	var msgContent = requestResult.result;
	/**var warnLevel =data[0].warnLevel;
	var time = data[0].time;
	var regionName = data[0].regionName;
	var stayPersonCnts = data[0].stayPersonCnts;

	var msgContent = "";
	if( warnLevel == '红色' ){
		msgContent = warnLevel+"告警：【"+regionName+"】景区，"+time+"游客数达到"+stayPersonCnts+"人，请限制景区客流量。";
	}else if( warnLevel == '橙色' ){
		msgContent = warnLevel+"预警：【"+regionName+"】景区，"+time+"游客数达到"+stayPersonCnts+"人，请提前做好景区客流量控制。";
	}else{
		msgContent = warnLevel+"预警：【"+regionName+"】景区，"+time+"游客数达到"+stayPersonCnts+"人，请密切关注景区客流量。";
	}**/

	$("#msgContent").html(msgContent);  

	warnMessageInfoObj = {};

	//加载管理人员手机号码
	var managerInfoList = requestResult.managerInfo;
	var phoneListHtml = "";
	var strFormat = '<li><input id="phoneId_$1" onblur="checkNameUnique(this)" type="text" maxlength="11" value="$2" disabled="disabled" title="$3"/>' +
			'<span id="phoneDelId_$1" onclick="delPhoneOnclick(this)">-</span></li>';
//	for( var i=0; i<managerInfoList.length; i++ ){
//		phoneListHtml += strFormat.replace(/\$1/g, i)
//								  .replace(/\$2/g, managerInfoList[i].phone)
//								  .replace(/\$3/g, managerInfoList[i].name);
//	}

	warnMessageInfoObj.defaultContent = '<li><input id="phoneId_0" onblur="checkNameUnique(this)" type="text" maxlength="11" placeholder="请输入号码"/>' +
	'<span id="phoneDelId_0" onclick="delPhoneOnclick(this)">-</span></li>';

	if( phoneListHtml.length == 0 ){
		phoneListHtml += warnMessageInfoObj.defaultContent;

		//群组发送取消选择
		$("#groupSendInput").prop("checked",false);
		$("#groupSendInput").attr("disabled","disabled");
		warnMessageInfoObj.hasContent = false;
	}else{
		$("#groupSendInput").prop("checked",true);
		$("#groupSendInput").removeAttr("disabled");
		warnMessageInfoObj.hasContent = true;
	}
	phoneListHtml += '<span id=\"addPhone\" onclick=\"addPhoneOnclick(this)\">+ </span> </ul>';
	$("#phoneNums").empty().html(phoneListHtml);

	warnMessageInfoObj.defaultContent += '<span id=\"addPhone\" onclick=\"addPhoneOnclick(this)\">+ </span> </ul>';
	warnMessageInfoObj.htmlContent = phoneListHtml;
}

/**
 * 创建预警处理框
 * @param data
 */
function buildMessigeBoxGroup(requestResult){
	var msgContent = requestResult.result;
	var  size= requestResult.managerInfo[0].size;
	if (size == null) {
		size=0;
	}
	/**
	var warnLevel =data[0].warnLevel;
	var time = data[0].time;
	var regionName = data[0].regionName;
	var stayPersonCnts = data[0].stayPersonCnts;
	
	var msgContent = "";
	if( warnLevel == '红色' ){
		msgContent = warnLevel+"告警：【"+regionName+"】景区，"+time+"游客数达到"+stayPersonCnts+"人，请限制景区客流量。";
	}else if( warnLevel == '橙色' ){
		msgContent = warnLevel+"预警：【"+regionName+"】景区，"+time+"游客数达到"+stayPersonCnts+"人，请提前做好景区客流量控制。";
	}else{
		msgContent = warnLevel+"预警：【"+regionName+"】景区，"+time+"游客数达到"+stayPersonCnts+"人，请密切关注景区客流量。";
	}
	**/
	$("#msgContentGroup").html(msgContent);
	var html=$("#numberGroup li a").html();
	$("#iMessageGroup").attr("size",size);
	$("#numberGroup li a").html(html+"("+size+"人)<span>»</span>");
}

/**
 * 校验电话输入框
 * @returns {String}
 */
function checkNameUnique(obj){
	var inputStr = $(obj).val().trim();
	var reg = /^0?1[3|4|5|8][0-9]\d{8}$/;
	if (inputStr!=null&&reg.test(inputStr)) {
		$(obj).css("border","1px solid #f2f2f2");
		return true;
	}else{
		$(obj).css("border","1px dotted red");
		return false;
	}
}

/**
 * 校验短信内容输入框
 * @returns {String}
 */
function checkNameUnique2(obj){
	var inputStr = $(obj).val().trim();
	if (inputStr!=null&&inputStr!="") {
		$(obj).css("border","1px solid #f2f2f2");
		return true;
	}else{
		$(obj).css("border","1px dotted red");
		return false;
	}
}

/**
 * 生成日期
 * @param num
 * @returns
 */
function getDateByNum(num){
	var dd = new Date();
	dd.setDate(dd.getDate()+num);//获取AddDayCount天后的日期
	var m = dd.getMonth()+1;//获取当前月份的日期
	var d = dd.getDate();
	if(m<10){m="0"+m;}
	if(d<10){d="0"+d;}
	return m+"月"+d+"日";
}

/**
 * 生成天气PIC路径
 * @param num
 * @returns
 */
function getWeatherPic(weather,flag){
	var url="";
	//assets/css/images/weather/TB_yin.png
	if (weather.indexOf("雨夹雪")>-1) {
		url="assets/css/images/weather/sleet.png";
	}else if (weather.indexOf("暴雪")>-1) {
		url="assets/css/images/weather/snow_biggest.png";
	}else if (weather.indexOf("大雪")>-1) {
		url="assets/css/images/weather/snow_big.png";
	}else if (weather.indexOf("中雪")>-1) {
		url="assets/css/images/weather/snow_mid.png";
	}else if (weather.indexOf("小雪")>-1) {
		url="assets/css/images/weather/snow_small.png";
	}else if (weather.indexOf("暴雨")>-1) {
		url="assets/css/images/weather/rain_biggest.png";
	}else if (weather.indexOf("大雨")>-1) {
		url="assets/css/images/weather/rain_big.png";
	}else if (weather.indexOf("中雨")>-1) {
		url="assets/css/images/weather/rain_mid.png";
	}else if (weather.indexOf("小雨")>-1) {
		url="assets/css/images/weather/rain_small.png";
	}else if (weather.indexOf("雷阵雨")>-1) {
		url="assets/css/images/weather/thunder_shower .png";
	}else if (weather.indexOf("雷")>-1) {
		url="assets/css/images/weather/thunder .png";
	}else if (weather.indexOf("雨")>-1) {
		url="assets/css/images/weather/rain_small.png";
	}else if (weather.indexOf("阴")>-1) {
		url="assets/css/images/weather/overcast.png";
	}else if (weather.indexOf("雾")>-1) {
		url="assets/css/images/weather/fog.png";
	}else if (weather.indexOf("多云")>-1) {
		url="assets/css/images/weather/cloudy_sun.png";
	}else if (weather.indexOf("晴")>-1) {
		url="assets/css/images/weather/sunny_sun.png";
	}else if (weather.indexOf("扬")>-1) {
		url="assets/css/images/weather/sand_blowing .png";
	}else {
		url="assets/css/images/weather/default.png";
	}
	return url;
}

/**
 * 
 * @Description : 跳转至群发景区人员编辑页面
 * 
 * @return void
 *
 * @author : pengjy
 * @date : 2015年12月21日 下午8:21:52 
 *
 */
function gotoWarnGroup(){
	var areaId=$("#warnningBox ul li .p5[status='open']").attr("areaId");
	var areaName=$("#warnningBox ul li .p5[status='open']").attr("areaname");
	var str = '?areaId=' + areaId.EncodeBase64()+"&areaName="+areaName.EncodeBase64();
	window.open(CONTENT_PATH + '/zhly/warn_group_phone.jsp' + str, '');
}